an incorrect path to a file-backed VBD (disk image) or the file-backed
VBD does not exist.
Without this patch, if someone mis-types the path to the disk image,
he/she would have no indication as to what's wrong when the domain
fails to get created.
Signed-off-by: Khoa Huynh <khoa@us.ibm.com>
uname = sxp.child_value(info, 'uname')
typedev = sxp.child_value(info, 'dev')
(_, vbdparam) = string.split(uname, ':', 1)
+
+ if 'file:' in uname and not os.path.isfile(vbdparam):
+ raise VmError('Disk image does not exist: %s' % vbdparam)
+
if 'ioemu:' in typedev:
(emtype, vbddev) = string.split(typedev, ':', 1)
else: